//
//  NSArray+SKYSafeArray.h
//  SkyonSDK
//
//  Created by 张二帅 on 2018/5/19.
//  Copyright © 2018年 Skyon. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSArray (SKYSafeArray)

- (id)sky_safeObjectAtIndex:(NSUInteger)index;
+ (instancetype)sky_safeArrayWithObject:(id)object;
- (NSArray *)sky_safeSubarrayWithRange:(NSRange)range;
- (NSUInteger)sky_safeIndexOfObject:(id)anObject;

@end


@interface NSMutableArray (SKYSafeMutableArray)

/**
 添加空字符串

 @param amount 添加数量
 */
- (void)sky_addEmptyStringAmount:(NSUInteger)amount;

/**
 添加字符串，若value==nil，则添加空字符串

 @param value 被添加的字符串
 */
- (void)sky_addEmptyOrValueString:(NSString *)value;
- (void)sky_safeAddObject:(id)object;
- (void)sky_safeInsertObject:(id)object atIndex:(NSUInteger)index;
- (void)sky_safeInsertObjects:(NSArray *)objects atIndexes:(NSIndexSet *)indexs;
- (void)sky_safeRemoveObjectAtIndex:(NSUInteger)index;
- (void)sky_safeRemoveObjectsInRange:(NSRange)range;

@end
